<?php

declare(strict_types=1);

namespace SixShop\Wangdian\Exception;

/**
 * API response related exceptions
 */
class ApiException extends WangdianException
{
    public function __construct(
        string $message = '',
        int $code = 0,
        ?\Throwable $previous = null,
        ?array $context = null,
        protected readonly ?string $apiCode = null,
        protected readonly ?array $responseData = null
    ) {
        parent::__construct($message, $code, $previous, $context);
    }

    public function getApiCode(): ?string
    {
        return $this->apiCode;
    }

    public function getResponseData(): ?array
    {
        return $this->responseData;
    }
}